package com.hqyj.system.controller;

import com.hqyj.system.model.User;
import com.hqyj.system.model.UserPurchase;
import frame.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("/userPurchaseController")
public class UserPurchaseController  extends BaseController {
    @RequestMapping("/list.do")
    public String List(HttpServletRequest request, HttpServletResponse response, HttpSession session, Model model, User user,UserPurchase userPurchase) {
        //1.接收数据;
        //3.调用业务;
        List<UserPurchase> userPurchases_dbList = userPurchaseService.queryAllUserPurchase();
        model.addAttribute("userPurchases_dbList",userPurchases_dbList);
        //2.跳转页面;
        return "view/system/userPurchase/userPurchaseList";
    }
}